Documents for PDF, .NET Edition Documentation
BinarySearch(Int32,Int32,T,IStructComparer<T>) Method

GrapeCity.Documents.Common Assembly > GrapeCity.Documents.Common Namespace > StructList<T> Class > BinarySearch Method : BinarySearch(Int32,Int32,T,IStructComparer<T>) Method
The zero-based starting index of the range to search.
The length of the range to search.
The object to locate.
The IStructComparer<T> implementation to use when comparing elements.
Searches a range of elements in the sorted StructList<T> for an element using the specified comparer and returns the zero-based index of the element.
Syntax
'Declaration
 
Public Overloads Function BinarySearch( _
   ByVal index As System.Integer, _
   ByVal count As System.Integer, _
   ByRef item As T, _
   ByVal comparer As IStructComparer(Of T) _
) As System.Integer
public System.int BinarySearch( 
   System.int index,
   System.int count,
   ref T item,
   IStructComparer<T> comparer
)

Parameters

index
The zero-based starting index of the range to search.
count
The length of the range to search.
item
The object to locate.
comparer
The IStructComparer<T> implementation to use when comparing elements.

Return Value

The zero-based index of item in the sorted StructList<T>, if item is found; otherwise, a negative number that is the bitwise complement of the index of the next element that is larger than item or, if there is no larger element, the bitwise complement of Count.
See Also

Reference

StructList<T> Class
StructList<T> Members
Overload List